// 摘自
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {

  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  bool ok = true;
  vector<int> ans(n + 1);
  vector<bool> used(n + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == -1)
      continue;
    if (used[a[i]]) {
      ok = false;
      break;
    }
    ans[i] = a[i];
    used[a[i]] = true;
  }
  if (ok) {
    cout << "Yes" << '\n';
    int cur = 1;
    for (int i = 1; i <= n; i++) {
      if (ans[i] == 0) {
        while (used[cur])
          cur++;
        ans[i] = cur++;
      }
      cout << ans[i] << " \n"[i == n];
    }
  } else
    cout << "No" << '\n';
}